package gdut;

import gdut.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import pojo.UserInfoRegisterRequest;
import pojo.UserInfoRequest;
import pojo.UserInfoResponse;
import pojo.UserLoginResponse;

@FeignClient(value = "user-service",path = "/user")
public interface UserServiceAPI {
    @RequestMapping("/login")
    Result<UserLoginResponse> login(@RequestBody UserInfoRequest user);
    @RequestMapping("/register")
    Result<Integer> register(@RequestBody UserInfoRegisterRequest userInfoRegisterRequest);
    @RequestMapping("/getUserInfo")
    Result<UserInfoResponse> getUserInfo(@RequestParam("userId") Integer userId);
    @RequestMapping("/getAuthorInfo")
    Result<UserInfoResponse> getAuthorInfo(@RequestParam("blogId") Integer blogId);
}
//测试一：http://127.0.0.1:8080/user/getAuthorInfo?blogId=1